﻿using System.Drawing;
using System.IO;
using PlanningGIS.DataConvert.form;
using ESRI.ArcGIS.ADF.BaseClasses;
using System.Resources;
using PlanningGIS.Framework;


namespace PlanningGIS.DataConvert.button
{
    public class btnDataExcavate: BaseCommand
    {
        IApplication m_Application = null;

        public btnDataExcavate()
        {
            base.m_caption = "数据挖除";
            base.m_toolTip = base.m_caption;
        }

        public override void OnCreate(object hook)
        {
            m_Application = hook as IApplication;
        }

        public override bool Enabled
        {
            get
            {
                return (m_Application as IFramework).IsMapCtrlactive;
            }
        }

        public override void OnClick()
        {
            FrmDataExcavate frmDataExvavate = FrmDataExcavate.GetDataExcavateForm(m_Application);
            if (frmDataExvavate.Visible == false) frmDataExvavate.Show((m_Application as IFramework).MdiForm);
        }

        public override int Bitmap
        {
            get
            {
                string bitmapResourceName = "PlanningGIS.DataConvert.Res." + this.GetType().Name + ".png";
                System.IO.Stream pStream = GetType().Assembly.GetManifestResourceStream(bitmapResourceName);
                if (pStream == null) return 0;
                return new Bitmap(pStream).GetHbitmap().ToInt32();
            }
        }

    
    }
}
